<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<p>flexmark-java extension for application specific macros</p>
<p>Macros come in two forms: block and inline. Block macros can include multi-line content,
including blank lines. The content can contain other markdown elements and is parsed for inline
markdown content.</p>
<p>Inline macros can contain multi-line content but not blank lines because they are fully
contained in a single paragraph block.</p>
<p>Opening and closing block macro markers must be the first and last non-blank content on a line.
Other than this distinction there is no difference in handling macros by the extension between
inline and block macros. This means that inline macros will always be part of a paragraph block
content, even if the inline macro is the only content. If these inline macros are desired to be
processed as block macros then a node post processor should be used to transform these
paragraphs to block macros.</p>
<h3 id="block-macros">Block Macros</h3>
<pre><code class="markdown">{{macroName attribute1=value attribute2 attribute3=&quot;value any content&quot;}} 
content of the macro block, can include other block macros

blank lines and any other markdown element
{{/macroName}}
</code></pre>
<pre><code class="markdown">{{macroName attribute3=&quot;value with possible spaces&quot;}}content{{/macroName}}
</code></pre>
<p>Block Macros without content:</p>
<pre><code class="markdown">{{macroName attribute1=value attribute2}}{{/macroName}}
</code></pre>
<pre><code class="markdown">{{macroName attribute1=value attribute2 /}}
</code></pre>
<pre><code class="markdown">{{macroName /}}
</code></pre>
<p>General form of an inline macro is the same as the block form except the opening and/or closing
marker has a blank or non-blank text prefix and/or non blank text suffix, or both opening and
closing markers are contained on the same line.</p>
<h3 id="inline-macros">Inline Macros:</h3>
<p>A non-indenting space should be included before the opening and closing inline macro to prevent
it from being interpreted as a block macro.</p>
<p><img src="information_source.png" alt="emoji symbols:information_source" height="20" width="20"> Non-indenting space below is replaced with <code>․</code></p>
<pre><code class="markdown">․{{macroName attribute4='another format'}} 
possibly containing other lines, but no blank lines 
․{{/macroName}}
</code></pre>
<pre><code class="markdown">prefix text {{macroName attribute1=value}}
content possibly containing other lines, but no blank lines
lines {{/macroName}}
</code></pre>
<p>Single line inline macros:</p>
<pre><code class="markdown">․{{macroName attribute3=&quot;value with possible spaces&quot;}}content{{/macroName}}
</code></pre>
<p>Inline Macros without content:</p>
<pre><code class="markdown">․{{macroName attribute1=value attribute2}}{{/macroName}}
</code></pre>
<pre><code class="markdown">․{{macroName attribute1=value attribute2 /}}
</code></pre>
<pre><code class="markdown">․{{macroName /}}
</code></pre>
<p>AST for block macro will start with the <code>Macro</code> node and if there was a closing marker then a
<code>MacroClose</code> will be the last child node.</p>
<p>Macro attributes, if any, are included as child blocks of the <code>Macro</code> node.</p>
</body>
</html>
